/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Wires.impl;

import EA_Model.IEC61970.Domain.Reactance;
import EA_Model.IEC61970.Domain.Resistance;

import EA_Model.IEC61970.LoadModel.impl.SeasonDayTypeScheduleImpl;

import EA_Model.IEC61970.Wires.RegulationSchedule;
import EA_Model.IEC61970.Wires.WiresPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Regulation Schedule</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.RegulationScheduleImpl#getLineDropCompensation <em>Line Drop Compensation</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.RegulationScheduleImpl#getLineDropR <em>Line Drop R</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.RegulationScheduleImpl#getLineDropX <em>Line Drop X</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RegulationScheduleImpl extends SeasonDayTypeScheduleImpl implements RegulationSchedule {
	/**
	 * The cached value of the '{@link #getLineDropCompensation() <em>Line Drop Compensation</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLineDropCompensation()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean lineDropCompensation;

	/**
	 * The cached value of the '{@link #getLineDropR() <em>Line Drop R</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLineDropR()
	 * @generated
	 * @ordered
	 */
	protected Resistance lineDropR;

	/**
	 * The cached value of the '{@link #getLineDropX() <em>Line Drop X</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLineDropX()
	 * @generated
	 * @ordered
	 */
	protected Reactance lineDropX;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected RegulationScheduleImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.REGULATION_SCHEDULE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getLineDropCompensation() {
		if (lineDropCompensation != null && lineDropCompensation.eIsProxy()) {
			InternalEObject oldLineDropCompensation = (InternalEObject)lineDropCompensation;
			lineDropCompensation = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldLineDropCompensation);
			if (lineDropCompensation != oldLineDropCompensation) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.REGULATION_SCHEDULE__LINE_DROP_COMPENSATION, oldLineDropCompensation, lineDropCompensation));
			}
		}
		return lineDropCompensation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetLineDropCompensation() {
		return lineDropCompensation;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLineDropCompensation(EA_Model.IEC61970.Domain.Boolean newLineDropCompensation) {
		EA_Model.IEC61970.Domain.Boolean oldLineDropCompensation = lineDropCompensation;
		lineDropCompensation = newLineDropCompensation;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.REGULATION_SCHEDULE__LINE_DROP_COMPENSATION, oldLineDropCompensation, lineDropCompensation));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance getLineDropR() {
		if (lineDropR != null && lineDropR.eIsProxy()) {
			InternalEObject oldLineDropR = (InternalEObject)lineDropR;
			lineDropR = (Resistance)eResolveProxy(oldLineDropR);
			if (lineDropR != oldLineDropR) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.REGULATION_SCHEDULE__LINE_DROP_R, oldLineDropR, lineDropR));
			}
		}
		return lineDropR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Resistance basicGetLineDropR() {
		return lineDropR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLineDropR(Resistance newLineDropR) {
		Resistance oldLineDropR = lineDropR;
		lineDropR = newLineDropR;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.REGULATION_SCHEDULE__LINE_DROP_R, oldLineDropR, lineDropR));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance getLineDropX() {
		if (lineDropX != null && lineDropX.eIsProxy()) {
			InternalEObject oldLineDropX = (InternalEObject)lineDropX;
			lineDropX = (Reactance)eResolveProxy(oldLineDropX);
			if (lineDropX != oldLineDropX) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.REGULATION_SCHEDULE__LINE_DROP_X, oldLineDropX, lineDropX));
			}
		}
		return lineDropX;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Reactance basicGetLineDropX() {
		return lineDropX;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLineDropX(Reactance newLineDropX) {
		Reactance oldLineDropX = lineDropX;
		lineDropX = newLineDropX;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.REGULATION_SCHEDULE__LINE_DROP_X, oldLineDropX, lineDropX));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_COMPENSATION:
				if (resolve) return getLineDropCompensation();
				return basicGetLineDropCompensation();
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_R:
				if (resolve) return getLineDropR();
				return basicGetLineDropR();
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_X:
				if (resolve) return getLineDropX();
				return basicGetLineDropX();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_COMPENSATION:
				setLineDropCompensation((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_R:
				setLineDropR((Resistance)newValue);
				return;
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_X:
				setLineDropX((Reactance)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_COMPENSATION:
				setLineDropCompensation((EA_Model.IEC61970.Domain.Boolean)null);
				return;
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_R:
				setLineDropR((Resistance)null);
				return;
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_X:
				setLineDropX((Reactance)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_COMPENSATION:
				return lineDropCompensation != null;
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_R:
				return lineDropR != null;
			case WiresPackage.REGULATION_SCHEDULE__LINE_DROP_X:
				return lineDropX != null;
		}
		return super.eIsSet(featureID);
	}

} //RegulationScheduleImpl
